import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @version 1.8
 * @Author Djx_hmbb
 * @Date 2023/8/21 21:09
 * @注释:线程池
 */
public class ThreadDemo23 {
    public static void main(String[] args) {
        ExecutorService pool = Executors.newCachedThreadPool();
        for (int i = 0; i < 100; i++) {
            int n = i;
            pool.submit(new Runnable() {
                @Override
                public void run() {
                    System.out.println(n);
                }
            });
        }
    }
}
